package com.yusheng.controller;

import com.google.gson.Gson;
import com.yusheng.dao.QueryStaff;
import com.yusheng.entity.ApprovalRecordList;
import jdk.internal.util.xml.impl.Input;

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.io.PrintWriter;

public class ApprovalDetail extends HttpServlet {


    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html;charset=utf-8");
        InputStream in= request.getInputStream();
        byte[] stuffNo1=new byte[200];
        in.read(stuffNo1);
        String stuffNo=new String(stuffNo1);
        //response.setCharacterEncoding("utf-8");
        ApprovalRecordList approvalRecordList= QueryStaff.getApprovalRecordsByStuffNo(stuffNo);
        Gson gson=new Gson();
        String approvalRecords=gson.toJson(approvalRecordList);
        PrintWriter out=response.getWriter();
        out.print(approvalRecords);
    }
}
